<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${sectionName}"></title>
    <link rel="stylesheet" href="/css/bootstrap.css"/>
    <link rel="stylesheet" href="/css/bootstrap-theme.min.css"/>
    <script src="/js/JQuery.js"></script>
    <script type="application/javascript" src="/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/index.css">
    <link rel="stylesheet" href="/css/profile.css">
</head>
<body>
<!--导入navigation.html中的nav-->
<div th:insert="~{navigation :: nav}"></div>
<!--主要内容模块-->
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12" style="">
            <h2><span th:text="${sectionName}"></span></h2>
            <hr>
            <!--我的问题展示-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" th:if="${section == 'question'}">
                <div class="media" th:each="pagination : ${paginationDTO.dataDTOList}">
                    <div class="media-left">
                        <a href="#">
                            <img class="media-object img-circle" th:src="${pagination.user.getAvatarUrl()}" alt="...">
                        </a>
                    </div>
                    <div class="media-body">
                        <a th:href="${'/questiondetail/'+pagination.id}"><h4 class="media-heading"
                                                                             th:text="${pagination.title}"></h4></a>
                        <span th:text="${pagination.description}"></span><br>
                        <span class="state-text"><span th:text="${pagination.commentCount}"></span>个回复<span
                                style="margin: 0 10px 0px 10px;"> • </span><span
                                th:text="${pagination.readCount}"></span>次浏览<span
                                style="margin: 0 10px 0px 10px;"> • </span>创建日期：<span
                                th:text="${#dates.format(pagination.gmtCreate,'yyyy-MM-dd HH:mm:ss')}"></span></span>
                        <a th:href="@{'/askquestion/'+${pagination.id}}" class="edit-question">
                            <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>问题编辑
                        </a>
                    </div>
                </div>
            </div>
            <!--最新回复-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 replys" th:if="${section == 'reply'}">
                <div th:each="notification : ${paginationDTO.dataDTOList}">
                    <p>
                        <span th:text="${notification.notifierName+' '+notification.typeName+' '}"></span>
                        <a th:href="@{'/notification/'+${notification.id}}" th:text="${notification.outerTitle}"></a>
                        <span class="label label-danger" th:if="${notification.status == 0}">未读</span>
                    </p>
                </div>
            </div>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <!--第一页-->
                    <li th:if="${paginationDTO.showFirstPage}">
                        <a th:href="@{'/profile/'+${section}(page=1)}" aria-label="Previous">
                            <span aria-hidden="true">&lt;&lt;</span>
                        </a>
                    </li>
                    <!--上一页-->
                    <li th:if="${paginationDTO.showPreviousPage}">
                        <a th:href="@{'/profile/'+${section}(page=${paginationDTO.page-1})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;</span>
                        </a>
                    </li>
                    <!--显示当前页-->
                    <li th:each="page : ${paginationDTO.pages}"
                        th:class="${paginationDTO.page == page} ? 'active' : ''"><a
                            th:href="@{'/profile/'+${section}(page=${page})}" th:text="${page}"></a></li>
                    <!--下一页-->
                    <li th:if="${paginationDTO.showNextPage}">
                        <a th:href="@{'/profile/'+${section}(page=${paginationDTO.page+1})}" aria-label="Next">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li>
                    <!--最后一页-->
                    <li th:if="${paginationDTO.showEndPage}">
                        <a th:href="@{'/profile/'+${section}(page=${paginationDTO.totalPage})}" aria-label="Next">
                            <span aria-hidden="true">&gt;&gt;</span>
                        </a>
                    </li>
                </ul>
            </nav>
            </div>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12" style="padding-top: 50px; margin-bottom: 30px">
            <div class="list-group">
                <a href="/profile/question" style="text-align: center;"
                   th:class="${section == 'question'} ? 'active list-group-item' : 'list-group-item'">
                    我的问题
                </a>
                <a href="/profile/reply" style="text-align: center;" class="a-text-center"
                   th:class="${section == 'reply'} ? 'active list-group-item' : 'list-group-item'">
                    最新回复
                    <span class="badge" th:text="${unreadCount}"></span>
                </a>
            </div>
        </div>
    </div>
</div>
</body>
</html>